package com.jiankang.askhealth.taglibs;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class PageTag  extends ComponentTagSupport {
    private static final long serialVersionUID = -8812389048518057459L;
    private String pageIndex;;  
    private String total;  
    private String pageSize;
    private String url;
    private String styleClass;
    private String method = "post";
      
 
  
    @Override 
    public Component getBean(ValueStack arg0, HttpServletRequest arg1, HttpServletResponse arg2) {  
        return new Pages(arg0, arg1);  
    }  
 
    protected void populateParams() {  
        super.populateParams();  
          
        Pages pages = (Pages)component;  
        pages.setPageIndex(pageIndex);    
        pages.setTotal(total);  
        pages.setUrl(url);
        pages.setPageSize(pageSize);
        pages.setStyleClass(styleClass);
        pages.setMethod(method);
    }

    public String getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(String pageIndex) {
        this.pageIndex = pageIndex;
    }

    public String getTotal() {
        return total;
    }

    public void setTotal(String total) {
        this.total = total;
    }

    public String getPageSize() {
        return pageSize;
    }

    public void setPageSize(String pageSize) {
        this.pageSize = pageSize;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

	public String getStyleClass() {
		return styleClass;
	}

	public void setStyleClass(String styleClass) {
		this.styleClass = styleClass;
	}

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

}
